1. Field of the Invention
The present invention relates to a technology for encoding an image in an image processing apparatus.
2. Description of the Related Art
In recent years, there has been proposed a technology for reducing memory consumption when encoding an image so that an encoding apparatus can be made simpler. More particularly, an image to be encoded is divided into a plurality of rectangular blocks and then encoding is performed with respect to each rectangular block. With this technology, processing such as decoding and editing can be performed with respect to each piece of code data corresponding to each rectangular block which leads to reduction in memory consumption.
However, division of the image into the rectangular block leads to generation of noise such as block-noise. A digital camera having a measure for such a problem is disclosed in, for example, Japanese Patent Application Laid-open No. 2002-271790. In this technology, a user is allowed to determine the boundaries of the rectangular blocks upon dividing an image into the rectangular blocks so that the user can control a position of image discontinuity in the decoded image of the rectangular blocks as desired.
Meanwhile, when an image is to be decoded and edited with respect to each code data corresponding to each rectangular block, there may be a case that code data corresponding to a rectangular block other than a rectangular block being processed or code data corresponding to the entire image needs to be updated depending on the contents of editing. In this case, if the code data of the entire image is decoded and then re-encoded, costs for the decoding and the re-encoding increase.
For example, Japanese Patent Application Laid-open No. 2006-86579 discloses an image processing apparatus having a measure for such a problem. Specifically, the image processing apparatus is configured such that a code amount of code data corresponding to a rectangular block obtained after the editing will be equal to a code amount of code data corresponding to the rectangular block before the editing. As a result, updating of information about the code amount of code data corresponding to a rectangular block other than the rectangular block being processed or the code amount of code data corresponding to the entire image can be omitted.
However, the technologies disclosed in Japanese Patent Application Laid-open No. 2002-27190 and Japanese Patent Application Laid-open No. 2006-86579 do not take into account a case where a reference relation exists among a plurality of rectangular blocks. More particularly, when image data of a rectangular block adjacent to a rectangular block to be processed (hereinafter, “target rectangular block”) is used for performing filtering process for removing noise, or when the target rectangular block is encoded by performing predictive coding between rectangular blocks with regard to transform coefficients obtained through orthogonal transform performed on the rectangular blocks, and if image data of the target rectangular block is changed, a rectangular block that refers to the target rectangular block also needs to be re-encoded.
If editing is performed without taking the reference relation into account, re-encoding needs to be performed to decode the entire image, editing needs to be performed on the entire image, and then the entire image needs to be re-encoded. However, this process reduces the advantage of performing encoding with respect to each rectangular block and generating code data for each rectangular block.